<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/messages.jsp"%>
<html>
<head>
<link href="${ctx}/styles/aux_window.css" rel="stylesheet" type="text/css">

<%@ include file="/commons/dateTime.jsp" %>
<%@ include file="/commons/validation.jsp" %>

<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/public.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/div/common.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/pages/com/ce/pms/customer/tenement.js"></script>

<script type="text/javascript">
	var oldForm = null; //序列化表单
	var enterprise = null;
	function submitForm(){
		var isPass=$("organizationOwner").fireEvent("onSubmit");
		if(!isPass){ return;}
		var str = ${"organizationOwner"}.serialize();
		var action = document.forms.organizationOwner.action;
		var myAjax = new Ajax.Request(action,
                   {method: 'post', parameters: str, onComplete: closeFrm}
                   );
	}

	function closeFrm(){
		findFrame("ownerList").reLoadIframe();
		windowClose();
	}

	function closeBtn(){
		var newForm = $('organizationOwner').serialize();
		if(oldForm != newForm){
			AskConfirmTwo("数据已经发生改变，是否保存",'ownerEditFrm','submitForm','windowClose');
		}else{
			windowClose();
		}
	}

	function init(){
		oldForm = $('organizationOwner').serialize();
		enterprise = new Enterprise('organizationOwner');
		enterprise.init();
	}
</script>
</head>
<body onload="init();">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="${ctx}/images/ico_Advance.gif" width="16" height="16" align="absmiddle"> <span class="window_head_intext">修改业主资料</span></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td valign="middle" class="content">
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="container_in_show">
      <tr>
        <td valign="top">
        	<div id="tab_Search"  style="height:428px;overflow:auto;">
                <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
                      <tr>
                        <td>
<form id="organizationOwner" action="${ctx}/customer_ownerAction.do?method=editOrganizationBaseCache" method="post" class="required-validate">
	<!-- 企业ID -->
 	<input type="hidden" id="oldParticipantId" name="oldParticipantId" value="${organization.participantId}">
 	<input type="hidden" id="participantId" name="participantId" value="${organization.participantId}">

 	<input type="hidden" id="index" name="index" value="${organization.index}">
 	<input type="hidden" id="optionType" name="optionType" value="isAddEdit">

	<!-- 法人ID -->
	<input id="oldCorporationId" type="hidden" name="oldCorporationId" value="${organization.corporationId}">
 	<input id="corporationId" type="hidden" name="corporationId" value="${organization.corporationId}">
	<!-- 代理人ID -->
	<input id="oldConsignerId" type="hidden" name="oldConsignerId" value="${organization.consignerId}">
 	<input id="consignerId" type="hidden" name="consignerId" value="${organization.consignerId}">

 	<input type="hidden" id="certificateTypeName" name="certificateTypeName" value="${organization.certificateTypeName}">
 	<input type="hidden" id="sysDate" name="sysDate" value="<fmt:formatDate value="${sysDate}" pattern="yyyy-MM-dd"/>">

   <table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color" id="table02">
       <tr>
         <td colspan="4" class="aux_titletable">企业信息</td>
       </tr>
       <tr>
         <td class="aux_intable_td1">单位名称：</td>
         <td class="aux_intable_require">
         		<input name="participantName"
         			   onblur="enterprise.processEnterpriseName(this.value);"
         			   maxlength="80"
         			   value="${organization.participantName}"
         			   type="text"
         			   class="inputtext required validate-char"
         			   size="16">                                      </td>
         <td class="aux_intable_td1">联系人：</td>
         <td class="aux_intable_td2"><input name="organizationLinkMan" maxlength="80" value="${organization.organizationLinkMan}" type="text" class="inputtext validate-char" size="16"></td>
       </tr>
       <tr>
         <td class="aux_intable_td1">单位地址：</td>
         <td class="aux_intable_td2"><input name="address" value="${organization.address}" maxlength="255" type="text" class="inputtext validate-char" size="16"></td>
         <td class="aux_intable_td1">联系电话：</td>
         <td class="aux_intable_td2"><input name="telephone" value="${organization.telephone}" maxlength="80" type="text" class="inputtext validate-char" size="16"></td>
       </tr>
       <tr>
         <td class="aux_intable_td1">邮政编码：</td>
         <td class="aux_intable_td2"><input name="zip" value="${organization.zip}" type="text" maxlength="30" class="inputtext validate-char" size="16"></td>
         <td class="aux_intable_td1">&nbsp;</td>
         <td class="aux_intable_td2">&nbsp;</td>
       </tr>
       <tr>
         <td colspan="4" class="aux_titletable">法人代表基本资料</td>
       </tr>
       <tr>
         <td class="aux_intable_td1">姓名：</td>
         <td class="aux_intable_require"><input name="organizationPersonName" maxlength="80" value="${organization.organizationPersonName}" type="text" class="inputtext required validate-char" size="16">                                      </td>
         <td class="aux_intable_td1">出生日期：</td>
         <td class="aux_intable_td2"><table border="0" cellspacing="0" cellpadding="0">
             <tr>

               <td><input name="corporationBirthDate" id="orgcorporationBirthDate" value="<fmt:formatDate value="${organization.corporationBirthDate}" pattern="yyyy-MM-dd"/>" type="text" class="inputtext  validate-date less-equals-than-sysDate" size="16"></td>
               <td width="4">&nbsp;</td>
               <td><img id="imgBirthDateOrgnization" src="${ctx}/images/ico_clock.gif" width="20" height="20"></td>
             </tr>
         </table></td>
       </tr>
       <tr>
         <td class="aux_intable_td1">称呼：</td>
         <td class="aux_intable_td2"><input name="appellative" id="orgAppellative"  value="${organization.appellative}" maxlength="20" type="text" class="inputtext validate-char" size="16"></td>
         <td class="aux_intable_td1">联系电话：</td>
         <td class="aux_intable_td2"><table border="0" cellspacing="0" cellpadding="0">
             <tr>
               <td><input name="organizationPersonPhone" value="${organization.organizationPersonPhone}" maxlength="80" type="text" class="inputtext validate-char" size="16"></td>
               <td width="4">&nbsp;</td>
               <td><img src="${ctx}/images/ico-aux_household_sj.gif" width="16" height="16"></td>
             </tr>
         </table></td>
       </tr>
       <tr>
         <td class="aux_intable_td1">性别：</td>
         <td class="aux_intable_require">
         <mypms:Radio id="ownerId" name="sex" code="CS_INDIVIDUAL_SEX" className="validate-one-required" selectValue="${organization.sex}"></mypms:Radio>
           </td>
         <td class="aux_intable_td1">电子邮件：</td>
         <td class="aux_intable_td2"><input name="email" id="orgEmail" value="${organization.email}" maxlength="50" type="text" class="inputtext validate-email" size="16"></td>
       </tr>
       <tr>
         <td class="aux_intable_td1">证件类型：</td>
         <td class="aux_intable_require">
        <pms:unitedSelect name="certificateType"
        					id="orgcertificateType"
         					dataList="${certificateTypeList}"
         					optionLabel="idTypeName"
         					optionValue="idTypeId"
         					className="select-one-required"
         					value="${organization.certificateType}"
         					onChange="enterprise.corporation();">
         </pms:unitedSelect>
         </td>
         <td class="aux_intable_td1">联系地址：</td>
         <td class="aux_intable_td2"><input id="orgLinkAddress"  name="linkAddress"  maxlength="255"  value="${organization.linkAddress}" type="text" class="inputtext validate-char" size="16"></td>
       </tr>
       <tr>
         <td class="aux_intable_td1">证件号码：</td>
         <td class="aux_intable_require"><input id="orgcertificateNo" name="certificateNo" onblur="enterprise.corporation();" value="${organization.certificateNo}" maxlength="36"  type="text" class="inputtext required validate-char" size="16">                                      </td>
         <td rowspan="2" valign="top" class="aux_intable_td1">备注：</td>
         <td rowspan="2" valign="top" class="aux_intable_td2"><textarea name="remark" cols="29" rows="2" class="textareatext max-length-1000">${organization.remark}</textarea></td>
       </tr>
       <tr>
         <td class="aux_intable_td1">户口所在地：</td>
         <td class="aux_intable_td2"><input id="orgRegisterPlace" name="registerPlace" value="${organization.registerPlace}" maxlength="200" type="text" class="inputtext validate-char" size="16"></td>
       </tr>
       <tr>
         <td colspan="4" class="aux_titletable">委托代理人</td>
       </tr>
       <tr>
         <td class="aux_intable_td1">姓名：</td>
         <td class="aux_intable_require"><input  name="consignerName" value="${organization.consignerName}" maxlength="80"  type="text" class="inputtext required validate-char" size="16"></td>

         <td class="aux_intable_td1">联系电话：</td>
         <td class="aux_intable_td2"><table border="0" cellspacing="0" cellpadding="0">
             <tr>
               <td><input name="consignerPhone" value="${organization.consignerPhone}"  maxlength="80" type="text" class="inputtext validate-char" size="16"></td>
               <td width="4">&nbsp;</td>
               <td><img src="${ctx}/images/ico-aux_household_sj.gif" width="16" height="16"></td>
             </tr>
         </table></td>
       </tr>
       <tr>
         <td class="aux_intable_td1">性别：</td>
         <td class="aux_intable_require">
         <mypms:Radio  name="consignerSex" code="CS_INDIVIDUAL_SEX" className="validate-one-required" selectValue="${organization.consignerSex}"></mypms:Radio>
           </td>
         <td class="aux_intable_td1">电子邮件：</td>
         <td class="aux_intable_td2"><table border="0" cellspacing="0" cellpadding="0">
             <tr>
               <td><input name="consignerEmail" type="text" class="inputtext validate-email" maxlength="50" value="${organization.consignerEmail}" size="16"></td>
               <td width="4">&nbsp;</td>
               <td><img src="${ctx}/images/ico-aux_household_email.gif" width="16" height="16"></td>
             </tr>
         </table></td>
       </tr>
       <tr>
         <td class="aux_intable_td1">证件类型：</td>
         <td class="aux_intable_require">
       <pms:unitedSelect name="consignerCertificateType"
         					dataList="${certificateTypeList}"
         					optionLabel="idTypeName"
         					optionValue="idTypeId"
         					className="select-one-required"
         					value="${organization.consignerCertificateType}"
         					onChange="enterprise.consigner();">
         </pms:unitedSelect>

         </td>
         <td class="aux_intable_td1">籍贯：</td>
         <td class="aux_intable_td2"><input name="consignerHomeplace" value="${organization.consignerHomeplace}" maxlength="200" type="text" class="inputtext validate-char" value="" size="16"></td>
       </tr>
       <tr>
         <td class="aux_intable_td1">证件号码：</td>
         <td class="aux_intable_require"><input name="consignerCertificateNo" onblur="enterprise.consigner();"  value="${organization.consignerCertificateNo}" maxlength="36" type="text" class="inputtext required validate-char" size="16">                                      </td>
         <td class="aux_intable_td1">联系地址：</td>
         <td class="aux_intable_td2"><input name="consignerAddress" value="${organization.consignerAddress}" maxlength="255" type="text" class="inputtext" value="" size="16"></td>
       </tr>

   </table>
</form>
						</td>
					  </tr>
			    </table>
			</div>
		  </td>
	</tr>
	</table>
	</td>
	</tr>
    <tr>
    <td class="window_footer">
    <table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td>&nbsp;</td>
          <td class="btn_between_space"></td>
          <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_21"></td>
              <td class="buttonOffMiddle" id="btn1_22" onClick="submitForm();"
                  onMouseOver="btn_change_over(2)" onMouseOut="btn_change_out(2)" onblur="btn_change(2)">
                  <img src="${ctx}/images/ico_ok.gif" alt="" width="14" height="14" border="0" align="absbottom"> 保 存</td>
              <td class="buttonOffRight" id="btn1_23"></td>
            </tr>
          </table></td>
          <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0" onClick="closeBtn();">
            <tr>
              <td class="buttonOffLeft" id="btn1_31"></td>
              <td class="buttonOffMiddle" id="btn1_32" onblur="btn_change(3)" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)"><img src="${ctx}/images/ico_cancel.gif" border="0" align="absmiddle" /> 关 闭</td>
              <td class="buttonOffRight" id="btn1_33"></td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<script type="text/javascript">
              Calendar.setup(
              {
	              inputField : "corporationBirthDate", // ID of the input field
	              ifFormat : "%Y-%m-%d", // the date format
	              button : "imgBirthDateOrgnization", // ID of the button
	              align          :    "Tl",           // alignment (defaults to "Bl")
			      singleClick    :    true
              }
              );
</script>
</body>
</html>